<template>
    <div>
      <h2>子组件</h2>
      <p>接收到的父组件数据: {{ parentData }}</p>
      <button @click="sendDataToParent">发送数据到父组件</button>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  
  const props = defineProps({
    parentData: String
  });
  
  const emit = defineEmits(['update-parent']);
  
  function sendDataToParent() {
    emit('update-parent', '这是子组件返回的数据234');
  }
  </script>